class Solution {
public:
    int numWays(int n) {
        int MOD = 1000000007;
        if (n < 2)
            return 1;
        int a = 1;
        int b = 1;
        int c = a + b;
        n -= 2;
        while (n--)
        {
            a = b;
            b = c;
            c = (a + b) % MOD;
        }
        return c;
    }
};